layui.define(['element', 'layer', 'form', 'upload'], function(exports) {
	var element = layui.element,
		$ = layui.jquery,
		layer = layui.layer,
		form = layui.form,
		upload = layui.upload;
		
	//切换
	$('#pnav a').click(function(){
		var src = $(this).data('url');
		
	});
	//普通图片上传
	var uploadInst = upload.render({
		elem: '#uploadlogo',
		url: '/upload/',
		before: function(obj) {
			//预读本地文件示例，不支持ie8
			layer.load(2, {shade: false});
		},
		done: function(res) {
			//如果上传失败
			if(res.code > 0) {
				return layer.msg('上传失败');
			}
			//上传成功
		},
		error: function() {
			//演示失败状态，并实现重传
			layer.msg('未知错误,请重试');
		}
	});

	exports('set', {}); //注意，这里是模块输出的核心，模块名必须和use时的模块名一致
});